<template>
  <div>
    <el-button type="primary">添加</el-button>

    <el-dialog title="添加数据"  :visible.sync="addVisible">
      <el-form :model="user">
        <el-form-item label="用户名">
          <el-input v-model="user.name" ></el-input>
        </el-form-item>
        <el-form-item label="电话">
          <el-input v-model="user.tel"></el-input>
        </el-form-item>
        <el-form-item label="邮箱">
          <el-input v-model="user.email"></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="addVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      addVisible: false,
      rules: {
        name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
        tel: [{ required: true, message: "请输入电话", trigger: "blur" }],
        email: [{ required: true, message: "请输入邮箱", trigger: "blur" }]
      }
    };
  }
};
</script>

<style>
</style>